package com.briup.demo.service.impl;

import com.briup.demo.bean.UserFile;
import com.briup.demo.dao.UserFileMapper;
import com.briup.demo.service.UserFileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author wyq
 * @create 2021-11-14 17:45
 */
@Service
public class UserFileServiceImpl implements UserFileService {
    @Resource
    private UserFileMapper userFileMapper;

    /**
     * Description: TODO  保存文件信息到数据库
     *
     * @author: wyq
     * @date: 2021/11/14 17:48
     * @Param file:
     * @return: void
     */

    @Override
    public void save(UserFile file) {
        userFileMapper.save(file);
    }

    /**
     * Description: TODO  根据文件id查询文件
     *
     * @author: wyq
     * @date: 2021/11/14 17:49
     * @Param id:
     * @return: com.briup.demo.bean.UserFile
     */

    @Override
    public UserFile findById(Integer id) {
        return userFileMapper.findById(id);
    }

    /**
     * Description: TODO  根据文件名称查询文件
     *
     * @author: wyq
     * @date: 2021/11/14 17:58
     * @Param name:
     * @return: com.briup.demo.bean.UserFile
     */
    @Override
    public UserFile findByName(String name) {
        return userFileMapper.findByName(name);
    }
}
